//
//  YCHeadView.swift
//  GZWeibo007
//
//  Created by 姚伟聪 on 15/12/25.
//  Copyright © 2015年 Apple. All rights reserved.
//

import UIKit

protocol YCHeadViewDelegate: NSObjectProtocol {

    func commentBtnClick()


}

class YCHeadView: UIView {

    
    //MARK: - 属性
    
    weak var delegate:YCHeadViewDelegate?
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        addUI()
        self.backgroundColor = UIColor.whiteColor()
        commentBtn.addTarget(self, action: "click", forControlEvents: UIControlEvents.TouchUpInside)
    }
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    private func addUI(){
        
        self.addSubview(commentBtn)
     
        
        commentBtn.ff_AlignInner(type: ff_AlignType.TopLeft, referView: self, size: CGSize(width: 44, height: 44), offset: CGPointZero)
    }
    
    private lazy var commentBtn: UIButton = {
        let btn = UIButton()
        
        btn.setTitle("评论", forState: UIControlState.Normal)
        btn.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        
        return btn
        
    }()
    
    func click(){
        delegate?.commentBtnClick()
    }

}
